package cn.yy.cloudpay.util;

import java.io.IOException;

import org.apache.log4j.Logger;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.SoapFault;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import org.xmlpull.v1.XmlPullParserException;

import android.util.Log;

public class WebserviceRequset {
	public static String requsetService(String parameters, String serverAddress) throws Exception {
		String s = "";
		SoapObject request = new SoapObject("http://service.mpos.webservice", "importService");
		request.addProperty("parameters", parameters);
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
		envelope.dotNet = true;
		envelope.bodyOut = request;
		/******正式环境********/
		//HttpTransportSE ht=new HttpTransportSE("",60000);	
		 /*******测试环境10.10.5.129:8080**/
		 HttpTransportSE ht = new HttpTransportSE("http://"+serverAddress+"/services/WebServiceImport?wsdl",60000);
		try {
			ht.call(null, envelope);
			SoapObject soapObject = (SoapObject) envelope.bodyIn;
			s = soapObject.getPropertyAsString("return");
		} catch (Exception e) {
			e.printStackTrace();
			throw e;
		}
		return s;
	}
}
